//JavaScript Framework 2.0 Code
try{
Type.registerNamespace('com.yonyou.dxyma.ScanController');
com.yonyou.dxyma.ScanController = function() {
    com.yonyou.dxyma.ScanController.initializeBase(this);
    this.initialize();
}
function com$yonyou$dxyma$ScanController$initialize(){
}
    
function com$yonyou$dxyma$ScanController$evaljs(js){
    eval(js);
}
function com$yonyou$dxyma$ScanController$twodimensioncode0_onscansuccess(sender, args){
    var scanString = $ctx.getString("result");
    var datas = $param.getJSONObject("data");
    $view.open({
        "viewid" : "com.yonyou.dxyma.Confirm",//目标页面（首字母大写）全名
        "isKeep" : "false",
        "user":$cache.read("user"),
        "ip" : $cache.read("ip"),
        "port" : $cache.read("port"),
        "data":datas,
        "scannerData":scanString
    })
}
//var confirm_data;
function com$yonyou$dxyma$ScanController$viewPage0_onload(sender, args){
	//var datas = $param.getJSONObject("data");
	//$alert("getdata success");
	//confirm_data = datas;
		if ($param.getString("ip") == "" && $param.getString("port") == ""&&$param.getString("user")=="") {
			var ip = $cache.read("ip");
			var port = $cache.read("port");
			var user = $cache.read("user");
		} else {
			var ip = $param.getString("ip");
			var port = $param.getString("port");
			var user = $param.getString("user");
			$cache.write("ip", ip);
			$cache.write("port", port);
			$cache.write("user",user);
		}
}
function com$yonyou$dxyma$ScanController$onkeydown(sender, args){

	var datas = $param.getJSONObject("data");
	mac = datas["mac"];
	pk = datas["pk"];
	var data_inf = {
			"mac": mac,
			"pk" : pk		
		}
	
	$view.open({
			"viewid" : "com.yonyou.dxyma.Infos", //目标页面（首字母大写）全名
			"isKeep" : "false",
			"data" : data_inf,
			"user":$cache.read("user"),
			"ip":$cache.read("ip"),
       		"port":$cache.read("port")
		});
/*
	$view.close({
        "resultCode": "15",//当resultCode为15时，可以响应父页面的callback
        "num": 0//返回结果，result1为自定义键值
    });
	/*$view.open({
		"viewid" : "com.yonyou.dxyma.Infos", //目标页面（首字母大写）全名
		"isKeep" : "false",
		"data" : confirm_data
	})*/
}
com.yonyou.dxyma.ScanController.prototype = {
    onkeydown : com$yonyou$dxyma$ScanController$onkeydown,
    viewPage0_onload : com$yonyou$dxyma$ScanController$viewPage0_onload,
    twodimensioncode0_onscansuccess : com$yonyou$dxyma$ScanController$twodimensioncode0_onscansuccess,
    initialize : com$yonyou$dxyma$ScanController$initialize,
    evaljs : com$yonyou$dxyma$ScanController$evaljs
};
com.yonyou.dxyma.ScanController.registerClass('com.yonyou.dxyma.ScanController',UMP.UI.Mvc.Controller);
}catch(e){$e(e);}
